package leetcodecompetition.D366;

/**
 * @Author: Siantar
 * @Date: 2023-10-08-10:32
 * @Description: 1.0
 */
public class T100103 {
    public int differenceOfSums(int n, int m) {
        int res = 0;
        for (int i = 1; i <= n; i++) {
            if (i % m == 0) {
                res -= i;
            } else {
                res += i;
            }
        }
        return res;
    }
}
